function getCookie(name)
{    
   var cookieArray=document.cookie.split("; ");
   var cookie=new Object();    
   for (var i=0;i<cookieArray.length;i++){    
      var arr=cookieArray[i].split("=");
      if(arr[0]==name)return unescape(arr[1]);
   } 
   return ""; 
} 

 

function delCookie(name)
{
   document.cookie = name+"=;expires="+(new Date(0)).toGMTString();
}



function setCookie(name,value)
{
    var Days = 30;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}